fix(review-memory): enforce structured output#4090
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryFocused refactor routes Review Memory model output through the AI SDK's native structured-output ( Notes
Files Reviewed (7 files)
Previous Review Summaries (4 snapshots, latest commit af7f029)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit af7f029)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental commit removes redundant JSON-shape examples from two LLM prompts; structured output is already enforced via the JSON schema passed to the provider, so the removal is safe and reduces prompt token usage. Incremental Changes (commit 8d2fcc4..HEAD)
No tests assert on the removed prompt text, and both prompts still describe the required Other Observations (not in diff)Carried forward from prior reviews for the author's consideration (unchanged, non-blocking):
Files Reviewed (2 files)
Previous review (commit 8d2fcc4)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental commit renames Incremental Changes (commit 77a4160..HEAD)
No remaining references to the old name found in the codebase. The new name is more accurate since the function only acts for the Other Observations (not in diff)Carried forward from prior reviews for the author's consideration (unchanged, non-blocking):
Files Reviewed (2 files)
Previous review (commit 77a4160)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental commit 77a4160 resolves the prior DRY finding by exporting Overview
Incremental Changes (commit 77a4160)
The previously reported SUGGESTION (duplicate Other Observations (not in diff)Carried forward from the prior review for the author's consideration (unchanged, non-blocking):
Files Reviewed (2 files)
Previous review (commit 0d8d493)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryStructured-output enforcement is well built with careful sanitization; the only finding is a minor DRY duplication of Overview
Issue Details (click to expand)SUGGESTION
Other Observations (not in diff)No blocking issues. A few low-confidence notes for the author's consideration:
Files Reviewed (14 files)
Reviewed by glm-5.2-20260616 · 1,135,271 tokens Review guidance: REVIEW.md from base branch |
|
|
||
| requestToMutate.body.provider = { | ||
| ...requestToMutate.body.provider, | ||
| require_parameters: true, |
There was a problem hiding this comment.
in what scenarios does setting this parameter make a difference?
Summary
Review Memory now asks the model for schema-checked JSON instead of trying to recover JSON from plain text. Bad or incomplete replies fail before any GitHub branch or pull request is created, while safe request details make failures easier to trace without storing prompts or model output. Structured-output routing is applied only where the selected provider supports it.
Verification
Visual Changes
N/A
Reviewer Notes
Provider-facing schemas remove unsupported rules, but the complete Zod schemas still validate every model reply inside the app. Failure reports contain only fixed messages, counts, and request IDs; they do not contain prompts, repository content, or raw model output.